home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 019a / amac40.zip / TIM004.QM < prev    next >
Text File  |  1991-08-03  |  12KB  |  238 lines

  1. *                               TIM004.QM
  2. *                        Written By Tom Hogshead
  3. *                       [ See TIMERxx.QM For Use ]
  4. *                            August 2, 1991
  5. *  Key    Subfile
  6. * =====  =========  =====================================================
  7. * @(r)            --Times Macro Command Sequences For 1 To 100,000 Repeats
  8. *                   Using [Cursor_Right] Timing Counter
  9. *     {e:\up\TIMER14}--Return To TIMERxx.QM
  10. *
  11. *-- eoi
  12.  
  13. * 
  14. * -------------------------------------------------------------------------
  15. * @(r)  Times Macro Command Sequences For 1 To 100,000 Repeats
  16. *       435 bytes Sat  07-13-1991  00:34:22 (TH @r, cursorright counter)
  17. * -------------------------------------------------------------------------
  18.  
  19. * This version is a modification of @1 that uses [ Cursor_Right ] as
  20. * the counting character instead of [ Del_Ch ] thereby reducing the
  21. * need for block filling. It is included here as an example of another
  22. * timing technique only.
  23.  
  24. * @r Base Time for 100k repeats is 227 seconds, about 10% less than @1
  25. * Base Time of 252 seconds:
  26.  
  27. *                               * 11:05:50  09:37  07-14-91 @r 100k 002
  28. *                               * 11:02:02  05:49  07-14-91 @r 100k 001
  29. *     180
  30. *      49
  31. *    -----
  32. *     229
  33. *      -2
  34. *    -----
  35. *     227 seconds, @r 100k Base Time, no counting characters
  36.  
  37. * No counting characters are used in @r as timed above.  Hovever, the
  38. * effect on timing by displaying counting charcters, even though they
  39. * are not needed in @r, can be seen by commenting the line "jump L5:";
  40. * then Base Time for 100k repeats more than doubles to 479 seconds:
  41.  
  42. *                               * 11:15:57  23:56  07-14-91 @r 100k 001
  43. *     480
  44. *      56
  45. *    -----
  46. *     536
  47. *     -57
  48. *    -----
  49. *     479 seconds, @r 100k Base Time, counting characters
  50.  
  51. @r  macrobegin
  52.     unmarkblock defaultwordset
  53.     setrmargin "80" return              * For timer messages on same line
  54.     insertline begline dropanchor
  55.     currentfilename copy                * Save currentfilename to return to
  56.     gotocolumn "41" return
  57.     dropanchor begline
  58.     fillblock "*" return                * Insert start line
  59.     editfile "0k" return quit           *
  60.     editfile return
  61.    "Cycle [Y=yes, Enter=no] ?"          * Y for yes, Enter for one cycle only
  62.     cursorright dropanchor
  63.     Pause
  64.     *---------------------------------------------------------------- *
  65.     *  Buffer                    Description                          *
  66.     * ========    =================================================== *
  67.     *     1   -   [Y] or [y] to cycle, [Enter] for only one cycle     *
  68.     *     2   -   Size = no of repeats to time, eg 1k = 1000 repeats  *
  69.     *     3   -   # of lines of counting characters                   *
  70.     *     4   -   # of counting characters per counting line          *
  71.     *     5   -   Character after buff 4 (* for 1/5/50/100 repeats)   *
  72.     *---------------------------------------------------------------- *
  73.     storescrbuff "1" return             * Y, or Enter for one cycle only
  74.     delline                             * Delete message line
  75.     editfile "$repeat" return
  76.     Pause
  77.     delrtword                           * Delete empty space
  78.     markcharacter                       *
  79.     gotocolumn "7" return               * Mark Size
  80.     storescrbuff "2" return             * Size
  81.     wordright                           *
  82.     markword                            *
  83.     storescrbuff "3" return             * # of AddLines
  84.     wordright markword                  *
  85.     storescrbuff "4" return             * Chars per line to delete
  86.     gotoblockend                        *
  87.     unmarkblock                         *
  88.     cursorright                         * Move to empty space
  89.     markcharacter                       * Start mark
  90.     endline                             * Mark buff 5
  91.     storescrbuff "5" return             * Store buff 5, blank if nothing
  92.     quit                                * Quit $repeat
  93.     editfile "$line#" return quit       * Quit $line# if loaded
  94.     editfile paste return               * Return to file we started in
  95.     onewindow
  96.     *--------------------------------------------------------*
  97.     * Window    File              Description                *
  98.     * ======   ======   ==================================== *
  99.     *   1               File to record timing record         *
  100.     *   2      0k       Zero length file to count repeats    *
  101.     *   3      $line#   contains 001-999 for cycle counting  *
  102.     *--------------------------------------------------------*
  103.     horizontalwindow                    * 0k window
  104.     editfile "0k" return
  105.     shrinkwindow
  106.     cursordown cursordown cursordown
  107.     cursordown cursordown cursordown
  108.     escape
  109.     horizontalwindow                    * Cycle # window
  110.     editfile "$line#" return
  111.     endline cursorright cursorright
  112. *-- InsertTime in $line#
  113.     inserttime                          * Insert approx start time in $line#
  114.     getscrbuff "2" return               * Insert size selected
  115.     unmarkblock
  116.     prevwindow                          * 0k window
  117.  CYCLE:
  118.         getscrbuff "3" return               * Get # of addlines
  119.         cut
  120.         begline                             *
  121.         getscrbuff "5" return               * Get buff 5
  122.         endline                             * Test if buff 5 has text
  123.         jfalse L1:                          * If false, buff 5 has no text
  124.         delline                             *ELSE buff has text
  125.         getscrbuff "4" return               * Get # of chars/line to count
  126.         cut                                 * Cut to scrap
  127.         begfile                             *
  128.         markcolumn                          *
  129.         gotocolumn paste return             * Go to end of block
  130.         fillblock "*" return                * Fill with stars
  131.         delch                               * Delete one counting char
  132.                                             * because delch "fail"= 1 rpt
  133. *       Pause                               * Add to see # of repeats - 1
  134.                                             * eg, 4 stars = 5 repeats
  135.         jump REFILL:                        *
  136.    L1:                                      *
  137.         delline                             * Delete extra line from buff 5
  138.         addline                             *
  139.         repeatcmd paste return              * Add lines for counting block
  140.         getscrbuff "4" return               * Get # of chars/line to count
  141.         cut                                 * Cut to scrap
  142.         cursorup cursorup                   * Move up to buff #4 line #
  143.    jump L5:                                 * Bypass block filling          |b
  144.    L2:  gotocolumn paste return             * Go to end of block
  145.         cursorleft                          * Position cursor one column
  146.                                             * left of # of counting chars
  147.                                             * because delch "fail"= 1 rpt
  148.         markcolumn begfile                  * Mark block end/begin
  149. *  L3:  fillblock "*" return jump REFILL:   * Count w/ all stars, for tests
  150. *  L4:  fillblock " " return jump REFILL:   * Empty block, for tests
  151.         fillblock  #248  return                         * °°°°°°°°°
  152.         gotocolumn "101" return fillblock #007 return   * 
  153.         gotocolumn "201" return fillblock #249 return   * ∙∙∙∙∙∙∙∙∙
  154.         gotocolumn "301" return fillblock #250 return   * ·········
  155.         gotocolumn "401" return fillblock "."  return   * .........
  156.  REFILL:
  157.         unmarkblock
  158.         endpara begline
  159.    L5:                                  *                                   |b
  160.         prevwindow                      * Timing record window
  161.         makectrofscreen
  162.         insertline begline
  163.        "*" gotocolumn "41" return "*"   * Insert starting line of stars
  164.         *-------------------------------------------------------------------*
  165.         * My DiskPark TSR parks my hard disk after 9 minutes of no access.  *
  166.         * I don't want TSR timing interference for > 9 minutes cycling.     *
  167.         * Add these 6 lines if you have TSR disk access during cycling.     *
  168.         *-------------------------------------------------------------------*
  169. *       getscrbuff "1" return     *                                         *
  170. *       endline                   * Test if 'y' to cycle                    *
  171. *       jfalse NOSAVE_FILE:       * If false, are at eol, don't save        *
  172. *       savefile                  *ELSE save file                           *
  173. *       NOSAVE_FILE:              *                                         *
  174. *       cut                       * Remove buffer 1 from screen             *
  175.         *-------------------------------------------------------------------*
  176.         cursorright
  177. * ■■■■■ Timing Starts Here ■■■■■
  178.         Insert_Time
  179.         nextwindow                      * 0k window
  180.     GOTOCOLUMN "13" return        *                                         |b
  181.         TIME:* 
  182. * **** < Commands to Time Inserted Here> ****
  183.         Cursor_Right                    * Timing counter                    |b
  184.         jtrue TIME:
  185.         prevwindow                      * Timing record window
  186.         gotocolumn "53" return
  187. *       500_TIME: insertline            * Add to show time after counting line
  188.         deltoeol                        * Delete previous time
  189.         Insert_Time
  190. * ■■■■■ Timing Ends Here ■■■■■
  191.         prevposition                    * Move to first char of time
  192.         delrtword delch                 * Delete 'Hour:'
  193.         nextwindow                      * 0k window
  194. *       begline                         * In case inserted commands move cur
  195.     GOTOCOLUMN "13" return              * Start counting in col 13          |b
  196.         cursorup                        * Move up to next counting line
  197.         jtrue TIME:                     *  until no more lines to count
  198.         nextwindow                      * Cycle # window
  199.         begline markword
  200.         copy                            * Copy current cycle # for timer
  201.         wordright
  202.         markcolumn endline markcolumn
  203.         gotoblockbeg cursordown
  204.         moveblock                       * Move start Time/Size to next line
  205.         unmarkblock
  206.         begline scrolldown
  207.         nextwindow                      * Timing record window
  208.         endline cursorright cursorright
  209.         insertdate                      * Insertdate
  210.         wordleft delch delch            * Delete 91
  211.         wordleft wordleft wordleft
  212.         delrtword                       * Delete day of week
  213.         endline cursorright "@r"        * Insert macro key
  214.         cursorright                     *
  215.         getscrbuff "2" return           * Insert size
  216.         gotocolumn "77" return          *
  217.         paste                           * Insert current cycle #
  218.         unmarkblock
  219.         nextwindow                      * 0k window
  220.     BEGLINE                             * Repostition cursor for cycle test |b
  221.         getscrbuff "1" return           * Get answer to cycle prompt
  222.         endline                         * Test if answered 'y' to cycle
  223.  jtrue CYCLE:                           * If true, are at eol, cycle again
  224.         prevwindow                      * Timing record window
  225.         dropanchor                      * Mark timer to return to
  226.         prevwindow                      * Cycle number window
  227.         quit                            * Quit $line#
  228.         editfile "0k" return quit       * Quit 0k
  229.         gotoblockbeg unmarkblock        * Return to file we started in
  230.         onewindow                       * Close all windows
  231.         begline cursorright cursorright * Position cursor to calculate time
  232. *
  233. * 380 bytes Mon  06-17-1991  21:41:37 (TH @1)
  234. * 380 bytes Fri  06-28-1991  07:26:45 (TH @1)
  235. * 419 bytes Sun  07-07-1991  13:56:04 (TH @1, added 1/5/50/100 repeats)
  236. * 435 bytes Sat  07-13-1991  00:34:22 (TH @r, cursorright counter |b)
  237.  
  238.